package com.example.jnnews;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

public class NewsActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_news);

        // 传递参数给Fragment
        NewsFragment fragment = new NewsFragment();
        fragment.setArguments(getIntent().getExtras()); // 直接传递全部Intent参数

        getSupportFragmentManager().beginTransaction()
                .replace(R.id.fragment_container, fragment)
                .commit();
    }
}